package com.smmisia.shop.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

@Getter
public enum ComboEnum {

    //0单票,1联票
    SINGLE_TICKET(0, "单票"),
    COMBO_TICKET(1, "联票");

    @EnumValue
    private int code;
    private String name;

    ComboEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static ComboEnum getEnumByCode(int code) {
        for (ComboEnum comboEnum : ComboEnum.values()) {
            if (comboEnum.getCode() == code) {
                return comboEnum;
            }
        }
        return null;
    }
}
